const config=require('../config');
module.exports = (message) => {
    let options = {
        ToUserName: message.FromUserName,
        FromUserName: message.ToUserName,
        CreateTime: Date.now(),
        MsgType: 'text'
    }
    //文本类型
    if (message.MsgType === 'text') {
        const content = message.Content;
        if (content === '1') {
            const text = "欢迎关注本公众号！！！\n  "+config.webUrl+"/index";
            options.content = text;
            options.MsgType='text';
        }else if(content ==='2'){
            options.MsgType='image';
            options.media_id='eSTvomym6Aa3W38L6u70J009hUXGcwhZE1Io7cObbS4Slp2g-VGiyl1YmQdf4lRu';

        }else if(content==='3'){
            options.MsgType='news';
        }else{
            options.MsgType = 'text';
            options.content='请选择正确的输入内容';
        }
    } else if (message.MsgType === 'image') {
        console.log(message)
        options.MsgType='image';
        options.media_id=message.MediaId;
    }

    return options;


}